//
//  Connectivity.m
//  MyOWNUITableView
//
//  Created by Jordy Heemskerk on 07-05-10.
//  Copyright 2010 ITopia. All rights reserved.
//

#import "Connectivity.h"

@implementation Connectivity

+ (NSString*)getBaseUrl {
	return [NSString stringWithFormat:@"http://localhost/~Jordy/ShopDeluxe/"];
}


+ (NSObject*)getProductsForDeviceWithId: (NSString*) did AndBtCodes: (NSMutableArray*) btcodes {
	
	NSString *urlstr = [[NSString alloc] initWithFormat:@"%@getProducts.php", [Connectivity getBaseUrl]];
	NSURL *url = [[NSURL alloc] initWithString:urlstr];
	NSString *data = [[NSString alloc] initWithContentsOfURL:url];
	
	/*NSXMLParser *parser = [[NSXMLParser alloc] initWithData:data];
	[parser setDelegate:self];
	[parser setShouldProcessNamespaces:NO];
    [parser setShouldReportNamespacePrefixes:NO];
    [parser setShouldResolveExternalEntities:NO];
	[parser parse];*/
	
	[urlstr release];
	[url release];
	[data release];
	urlstr = url = data = nil;
	
	
	return [[NSObject alloc] init];
}

- (void) parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName attributes:(NSDictionary *)attributeDict {
	NSLog(@"hooi");
	
}

- (void) parser:(NSXMLParser *)parser foundCharacters:(NSString *)string {
	NSLog(@"hooi");
	
}

- (void) parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName {
	NSLog(@"hooi");
	
	
}


@end
